package y.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import y.entity.MybatisUser;

import java.util.List;

public interface ZhuJieDao {
    //注解的方式实现对一张表的数据进行CRUD
    @Insert("insert into user values (#{id},#{name},#{phone})")
    public int insert(MybatisUser mybatisUser);

    @Delete("delete from user where id = #{id}")
    public int delete(int id);

    @Update("update user set id = #{id} ,name = #{name} ,phone = #{phone} where id = #{id}")
    public int update(MybatisUser mybatisUser);

    @Select("select * from user")
    public List<MybatisUser> selectAll();


}
